package com.xcity.pomelo.response;

import java.util.ArrayList;
import java.util.List;

import com.xcity.game.item.ItemInfo;
import com.xcity.game.item.ItemTemplate;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class OpenTreasureBoxResponse extends Response {

	protected List<ItemDetail> list;
	
	public static class ItemDetail {
		protected int id; // 物品id
		protected int count; // 物品数量
		protected String name;
		protected String icon;
		protected String desc;
		public int getId() {
			return id;
		}
		public void setId(int id) {
			this.id = id;
		}
		public int getCount() {
			return count;
		}
		public void setCount(int count) {
			this.count = count;
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public String getIcon() {
			return icon;
		}
		public void setIcon(String icon) {
			this.icon = icon;
		}
		public String getDesc() {
			return desc;
		}
		public void setDesc(String desc) {
			this.desc = desc;
		}
	}
	
	public OpenTreasureBoxResponse(int serial, ItemInfo item) {
		super(serial);
		list = new ArrayList<ItemDetail>(1);
		ItemDetail info = new ItemDetail();
		info.id = item.getId();
		info.count = item.getCount();
		ItemTemplate temp = item.getTemplate();
		info.name = temp.getName();
		info.icon = temp.getIcon();
		info.desc = temp.getDesc();
		list.add(info);
	}

	public List<ItemDetail> getList() {
		return list;
	}

	public void setList(List<ItemDetail> list) {
		this.list = list;
	}
	
}
